#ifndef SHORTCUT_H
#define SHORTCUT_H

#include <QObject>
#include <QAbstractNativeEventFilter>
#include <QDebug>
class QKeySequence;
class QGlobalShortcutPrivate;
class Shortcut : public QObject, public QAbstractNativeEventFilter
{
    Q_OBJECT
public:
    explicit Shortcut(QObject *parent = nullptr);
    ~Shortcut();

    bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
    QKeySequence shortcut();
    bool isEmpty();
    bool isEnabled();
signals:
    void activated();
public slots:
    bool setShortcut(const QKeySequence &keySequence);
    bool unsetShortcut();
    void setEnabled(bool enable);
private:
    QGlobalShortcutPrivate *sPrivate;

};

#endif // SHORTCUT_H
